package com.jason.bean;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;

import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;

@Entity(name = "user_info")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserInfo implements Serializable{
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	@Column(name = "nike_name",length=50, nullable = false)
	private String nikeName;
	@Column(name = "account",unique=true,length=50, nullable = false)
	private String account;
	@Column(name = "password",length=64, nullable = false)
	private String password;
	@CreationTimestamp
	@Column(name = "create_time", nullable = false)
	private Timestamp createTime;
	@UpdateTimestamp
	@Column(name = "update_time")
	private Timestamp updateTime;
	@Column(name = "status",length=2, nullable = false)
	private Integer status;
//	@ManyToMany(cascade = CascadeType.ALL,fetch=FetchType.LAZY)
//	@JoinTable(name = "user_role", 
//		joinColumns = @JoinColumn(name = "user_id",referencedColumnName="id"),
//		inverseJoinColumns = @JoinColumn(name = "role_id",referencedColumnName="id"))
//	private Set<Role> roles;
}
